#ifndef __TCPCONNECTION_H__
#define __TCPCONNECTION_H__

#include "Socket.h"
#include "SocketIO.h"
#include "InetAddress.h"

class TcpConnection
{
public:
    explicit TcpConnection(int fd);
    ~TcpConnection();
    void send(const string &msg);
    string receive();
    //为了方便调试的函数
    /* string toString();
    //判断连接是否断开了 */
    bool isClosed() const;
private:
    //获取本端地址与对端地址
    /* InetAddress getLocalAddr();
    InetAddress getPeerAddr();
 */
private:
    SocketIO _sockIO;

    //为了调试而加入的函数
    Socket _sock;
    //InetAddress _localAddr;
    //InetAddress _peerAddr;
};

#endif